###########################################################################################
# Build dataset required for training and test
# build_dataset.py is to convert dicom files to hdf5 files.
# flip_dataset.py is to train a network to predict whether CT is scanned from head to feet.
# You could sequentially execute the following commands by runing this bash script.
# Or simultaneously run commands in the recommended order to successfully run the code.
###########################################################################################

# test dataset
## kaggle stage2
python build_dataset.py -i '/data-disk/Kaggle/stage2' -o '../../data/stage2' -m 'kaggle'

# flip
## train network to flip CT according to kaggle stage1 data after being adjusted
## predict kaggle stage2 after training the 'flip regression' network
## codes and scripts are in another fold named as 'flip_regression'
## you could manually enter that fold to run the following bash
cd '../flip_regression'
bash flip_stage2.sh
cd '../data_builder'
## flip kaggle stage2 according to the list produced
python flip_dataset.py -d '../../data/stage2/vol.hdf5' -l '../../data/flip_regression/flip_list.npy'

